<?php

/**
 * Very simple factory,
 * which creates the Phlames using one precise class
 */
class MonoFactory implements Factory
{
	protected $_class = '';
	
	/**
	 * @param string $class creating classtype
	 */
	public function __construct($class)
	{
		if (!is_string($class) || empty($class) || !class_exists($class)) {
			throw new InvalidArgumentException('Invalid class given');
		}
		$this->_class = $class;
	}
	
	public function __toString()
	{
	    return get_class($this);
	}
	
	public function create(array $data)
	{
		return new $this->_class($data);
	}
}